package cn.janyd.common.core.util;

import java.util.regex.Pattern;

/**
 * @author janyd
 * @since 2020/8/10 16:28
 */
public class ValidationUtil {

    private static final Pattern PATTERN_MOBILE = Pattern.compile("^1\\d{10}$");

    public static boolean isMobile(String mobile) {
        if (mobile == null || mobile.length() != 11) {
            return false;
        }

        return PATTERN_MOBILE.matcher(mobile).matches();
    }
}
